home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12821 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: newsroom.hitc.com!kfreeman
  2. From: kfreeman@mandrake.HITC.COM (Keith Freeman)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: A garbage collection problem in C++
  5. Date: 21 Mar 1996 17:42:30 GMT
  6. Organization: Hughes Team (EOSDIS)
  7. Message-ID: <KFREEMAN.96Mar21124230@mandrake.HITC.COM>
  8. References: <4ic3vb$k0@mo6.rc.tudelft.nl> <4ic43s$k0@mo6.rc.tudelft.nl>
  9.     <WALD.96Mar16094305@woodpecker.lcs.mit.edu>
  10.     <4ifjh9$p6g@mo6.rc.tudelft.nl>
  11. NNTP-Posting-Host: mandrake.hitc.com
  12. In-reply-to: Ejo Schrama's message of 16 Mar 1996 23:40:25 GMT
  13.  
  14. In article <4ifjh9$p6g@mo6.rc.tudelft.nl> Ejo Schrama <schrama@geo.tudelft.nl> writes:
  15. > >...
  16. > >>  delete[] a,b;
  17. > >...
  18. > >
  19. > >What do you mean "second argument"?  It looks like that statement should
  20. >                    ^^^^^^^^^^^^^^^
  21. >                    I refered to b
  22.  
  23. But b is not a "second argument"; the delete [] operator only takes
  24. one argument, what your code does is use *comma* operator.  Here's
  25. another common example of misuse of the comma:
  26.  
  27. char a[10][10];  // 2-dimensional array
  28.  
  29. a[2,3] = 0;      // WRONG!  tries to assign 0 to a[2]
  30.  
  31. keith freeman
  32. kfreeman@eos.hitc.com
  33.  
  34.